//
//  LKMyChooseWorkerCell.m
//  YLHelper
//
//  Created by she1323 on 2018/5/11.
//  Copyright © 2018年 she1323. All rights reserved.
//

#import "LKMyChooseWorkerCell.h"

@interface LKMyChooseWorkerCell()
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *positionLabel;

@end


@implementation LKMyChooseWorkerCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    // Initialization code
}
-(void)setYewuyuanModel:(LKYewuyuanModel *)yewuyuanModel{
    _yewuyuanModel = yewuyuanModel;
    self.nameLabel.text = _yewuyuanModel.name;
    self.positionLabel.text = _yewuyuanModel.postName;
    [self setIconImagewWithName:_yewuyuanModel.name];
}
-(void)setIconImagewWithName:(NSString *)name{
    CDFInitialsAvatar *topAvatar = [[CDFInitialsAvatar alloc] initWithRect:self.iconImageView.bounds fullName:[name substringToIndex:1]];
    topAvatar.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"tx_five"]];
    topAvatar.initialsFont=[UIFont fontWithName:@"STHeitiTC-Light" size:14];
    CALayer *mask = [CALayer layer]; // this will become a mask for UIImageView
    UIImage *maskImage = [UIImage imageNamed:@"grayyuan_customer"]; // circle, in this case
    mask.contents = (id)[maskImage CGImage];
    mask.frame = self.iconImageView.bounds;
    self.iconImageView.layer.mask = mask;
    //_tximg.layer.cornerRadius = YES;
    self.iconImageView.image = topAvatar.imageRepresentation;
    _topAvatar=topAvatar;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
